Parse-duration
A simple utility to parse a duration string into milliseconds number.
Installation
yarn add @alwatr/parse-duration
Usage
import {parseDuration} from '@alwatr/parse-duration';
parseDuration('10s');
parseDuration('10m');
parseDuration('10h');
parseDuration('10d');
parseDuration('10w');
parseDuration('10M');
parseDuration('10y');
parseDuration('10d', 'h');
Unit Table
Unit | Description |
---|
s | Second |
m | Minute |
h | Hour |
d | Day |
w | Week |
M | Month |
y | Year |
The following companies, organizations, and individuals support Nanolib ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.
Contributing
Contributions are welcome! Please read our contribution guidelines before submitting a pull request.
License
This project is licensed under the AGPL-3.0 License.